<div id="viewer-container"></div>
<script>
  let viewer = undefined

  function generatePosition(num) {
    var list = []
    for (var i = 0; i < num; i++) {
      var lng = 120.38105869 + Math.random() * 0.5
      var lat = 31.10115627 + Math.random() * 0.5
      list.push(new DC.Position(lng, lat))
    }
    return list
  }

  function initViewer() {
    viewer = new DC.Viewer('viewer-container')
    let baselayer = DC.ImageryLayerFactory.createGoogleImageryLayer()
    viewer.addBaseLayer(baselayer)
    let layer = new DC.ClusterLayer('layer')
    viewer.addLayer(layer)
    let positions = generatePosition(10000)
    positions.forEach(item => {
      let billboard = new DC.Billboard(item, 'examples/images/icon/camera.png')
      layer.addOverlay(billboard)
    })
    viewer.flyTo(layer)
  }
  DC.ready(initViewer)
</script>
